package com.github.McPlugin.dao;


public enum  SQLCommand {
    //    活跃度
    CREATE_activeness(
            "CREATE TABLE  IF NOT EXISTS 'activeness' (\n" +
                    "                    'UUID' VARCHAR(255) NOT NULL ,\n" +
                    "                    'Month' INT NULL DEFAULT NULL,\n" +
                    "                    'Date' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "                    PRIMARY KEY ('UUID')\n" +
                    "                    )"
    ),
    DELETE_activeness(
            "DELETE FROM activeness WHERE UUID ='?'"
    ),
    ADD_activeness(
            "INSERT INTO 'activeness' \n" +
                    "                    ('UUID','Month','Date')\n" +
                    "                     VALUES ('?','?','?')"
    ),
    UPDATE_activeness(
            "UPDATE 'activeness'\n" +
                    "                    set 'Month'='?','Date'='?'\n" +
                    "                    WHERE UUID = '?'"
    ),
    SELECT_activeness(
            "SELECT * FROM activeness WHERE UUID = '?'"
    ),
    SELECT_activenessMonth(
            "SELECT Month FROM activeness WHERE UUID = '?'"
    ),
    SELECT_activenessDate(
            "SELECT Date FROM activeness WHERE UUID = '?'"
    ),
//    玩家信息

    CREATE_player(
            "CREATE TABLE IF NOT EXISTS 'player' (\n" +
                    "                'UUID' VARCHAR(255) NOT NULL ,\n" +
                    "                'PlayerName' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "                    PRIMARY KEY ('UUID')\n" +
                    "                    )"
    ),
    DELETE_player(
            "DELETE FROM 'player' WHERE UUID = '?'"
    ),
    SELECT_player(
            "SELECT PlayerName FROM player WHERE UUID = '?'"
    ),
    ADD_player(
            "INSERT INTO 'player' \n" +
                    "                    ('UUID','PlayerName')\n" +
                    "                    VALUES ('?','?')"
    ),
    UPDATE_player(
            "UPDATE Player\n" +
                    "                    set PlayerName='?' WHERE UUID = '?'"
    ),
    //签到
    CREATE_attendance(
            "            CREATE TABLE IF NOT EXISTS 'attendance' (\n" +
                    "                    'UUID' VARCHAR(255) NOT NULL ,\n" +
                    "                    'TotalTime' INT(11) NULL DEFAULT NULL,\n" +
                    "                    'MonthRecord' VARCHAR(255) NULL DEFAULT NULL, \n" +
                    "                     PRIMARY KEY ('UUID')\n" +
                    "                     )"
    ),
    DELETE_attendance(
            "DELETE FROM attendance WHERE UUID = '?'"
    ),
    ADD_attendance(
            "INSERT INTO 'attendance'\n" +
                    "                    ('UUID','TotalTime','MonthRecord')\n" +
                    "                    VALUES ('?',?,'?')"
    ),
    UPDATE_attendance(
            "UPDATE 'attendance'\n" +
                    "                    set TotalTime = ?,'MonthRecord'=?\n" +
                    "                    WHERE UUID = '?'"
    ),
    SELECT_attendance(
            "SELECT * FROM attendance WHERE UUID = '?'"
    ),
    SELECT_attendanceTotalTime(
            "SELECT TotalTime FROM attendance WHERE UUID = '?'"
    ),
    SELECT_attendanceMonthRecord(
            "SELECT MonthRecord FROM attendance WHERE UUID = '?'"
    ),
    //任务库
    CREATE_tasks(
            "            CREATE TABLE IF NOT EXISTS 'tasks'(\n" +
                    "                    'ID' INT NOT NULL ,\n" +
                    "                    'Name' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "                    'Type' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "                    'Description' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "                    'Request' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "                PRIMARY KEY ('ID')\n" +
                    "                    )"
    ),
    DELETE_tasks(
            "DELETE FROM tasks WHERE ID = ?"
    ),
    ADD_tasks(
            "INSERT INTO 'tasks'\n" +
                    "            ('ID','Name','Type','Description','Request')\n" +
                    "            VALUES (?,?,?,?,?)"
    ),
    SELECT_tasks(
            "SELECT * FROM tasks"
    ),
    SELECT_tasksName(
            "SELECT Name FROM tasks WHERE ID = ?"
    ),
    SELECT_tasksType(
            "SELECT Type FROM tasks WHERE ID = ?"
    ),
    SELECT_tasksDescription(
            "SELECT Description FROM tasks WHERE ID = ?"
    ),
    SELECT_tasksRequest(
            "SELECT Request FROM tasks WHERE ID = ?"
    ),
    UPDATE_tasks(
            "UPDATE 'tasks'\n" +
                    "                    set ID = ?,Name = ?,Type = ?,Description = ?, Request = ?\n" +
                    "                    WHERE ID = ?"
    ),

    //任务存档
    CREATE_unfinishedtasks(
            "CREATE TABLE IF NOT EXISTS 'unfinishedtasks' (\n" +
                    "                    'Date' DATE NOT NULL,\n" +
                    "                    'Data' VARCHAR(255) NULL DEFAULT NULL,                    \n" +
                    "                    PRIMARY KEY ('Date')\n" +
                    "                    )"
    ),
    DELETE_unfinishedtasks(
            "DELETE FROM unfinishedtasks WHERE Date =?"
    ),
    SELECT_unfinishedtasks(
            "SELECT * FROM unfinishedtasks WHERE Date = ?"
    ),
    ADD_unfinishedtasks(
            "INSERT INTO 'unfinishedtasks'\n" +
                    "                    ('Date','Data')\n" +
                    "                    VALUES (?,?)"
    ),
    UPDATE_unfinished(
            "UPDATE 'unfinishedtasks'\n" +
                    "                    set data = ?\n" +
                    "                    WHERE date = ?"
    ),
    //任务记录
    CREATE_finishedtasks(
            "CREATE TABLE IF NOT EXISTS 'finishedtasks' (\n" +
                    "                    'Date' DATE NOT NULL,\n" +
                    "                    'Data' VARCHAR(255) NULL DEFAULT NULL,                    \n" +
                    "                    PRIMARY KEY ('Date')\n" +
                    "                    )"
    ),
    DELETE_finishedtasks(
            "DELETE FROM finishedtasks WHERE Date =?"
    ),
    SELECT_finishedtasks(
            "SELECT * FROM finishedtasks WHERE Date = ?"
    ),
    ADD_finishedtasks(
            "INSERT INTO 'finishedtasks'\n" +
                    "                    ('Date','Data')\n" +
                    "                    VALUES (?,?)"
    ),
    UPDATE_finished(
            "UPDATE 'finishedtasks'\n" +
                    "                    set data = ?\n" +
                    "                    WHERE date = ?"
    ),
    //每日任务
    CREATE_dailytasks(
            "CREATE TABLE IF NOT EXISTS 'dailytasks' (\n" +
                    "                    'Date' DATE NOT NULL,\n" +
                    "                    'Data' VARCHAR(255) NULL DEFAULT NULL,                    \n" +
                    "                    PRIMARY KEY ('Date')\n" +
                    "                    )"
    ),
    DELETE_dailytasks(
            "DELETE FROM dailytasks WHERE Date =?"
    ),
    SELECT_dailytasks(
            "SELECT * FROM dailytasks WHERE Date = ?"
    ),
    ADD_dailytasks(
            "INSERT INTO 'dailytasks'\n" +
                    "                    ('Date','Data')\n" +
                    "                    VALUES (?,?)"
    ),
    UPDATE_daily(
            "UPDATE 'dailytasks'\n" +
                    "                    set data = ?\n" +
                    "                    WHERE date = ?"
    ),
    //商店商品
    CREATE_goods(
            "CREATE TABLE IF NOT EXISTS 'goods' (\n" +
                    "              ID int NOT NULL,\n" +
                    "              Name VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "              Number INT NULL DEFAULT NULL,\n" +
                    "              Price INT NULL DEFAULT NULL,\n" +
                    "              Type VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "              PRIMARY KEY ('ID')\n" +
                    "              )"
    ),
    DELETE_goods(
            "DELETE FROM goods WHERE ID = ?"
    ),
    ADD_goods(
            "INSERT INTO 'goods' \n" +
                    "                    ('ID','Name','Number','Price','Type')\n" +
                    "                    VALUES (?,'?',?,?,'?')"
    ),
    SELECT_goods(
            "SELECT * FROM goods WHERE ID = ?"
    ),
    SELECT_goodsname(
            "SELECT Name FROM goods WHERE ID = ?"
    ),
    SELECT_goodsNumber(
            "SELECT Number FROM goods WHERE ID = ?"
    ),
    SELECT_goodsprice(
            "SELECT Price FROM goods WHERE ID = ?"
    ),
    SELECT_goodstype(
            "SELECT Type FROM goods WHERE ID = ?"
    ),
    //销售记录
    CREATE_sell(
            "CREATE TABLE IF NOT EXISTS 'sell'(\n" +
                    "'ID' INT NOT NULL,\n" +
                    "'UUID' VARCHAR(255) NULL DEFAULT NULL,\n" +
                    "'Name' VARCHAR(255) Null DEFAULT NULL,\n" +
                    "'Number' INT NULL DEFAULT NULL,\n" +
                    "'Price' INT NULL DEFAULT NULL,\n" +
                    "'Time' DATETIME NULL DEFAULT NULL,\n" +
                    "PRIMARY KEY ('ID')\n" +
                    ")"
    ),
    ADD_sell(
            "INSERT INTO 'sell'\n" +
                    "('ID','UUID','Name','Number','Price','Time')\n" +
                    "VALUES(?,'?','?',?,?,?)"
    ),
    DELETE_sell(
            "DELETE FROM sell WHERE ID = ?"
    ),
    SELECT_sellUUID(
            "SELECT UUID FROM sell where ID = ?"
    ),
    SELECT_sellName(
            "SELECT Name FROM sell where ID = ?"
    ),
    SELECT_sellNumber(
            "SELECT Number FROM sell where ID = ?"
    ),
    SELECT_sellPrice(
            "SELECT Price FROM sell where ID = ?"
    ),
    SELECT_sellTime(
            "SELECT Time FROM sell where ID = ?"
    );



    private String command;

    SQLCommand(String command) {
        this.command = command;
    }

    public String commandToString() {
        return command;
    }
}
